#include "pack.h"
#include "card.h"

Pack::Pack()
{
	this->reserve(52);
	for (Byte s=0; s<4; ++s)
	{
		for (Byte r=0; r<13; ++r)
		{
			push_back(Card(s, r));
		}
	}
}

Card Pack::random()
{
	const Uint32&		newCardInd		=rand()%size();
	const Card			newCard			=(*this)[newCardInd];
	erase(begin()+newCardInd);

	return newCard;
}